/*
 * @Description: 备份计划弹窗
 * @Author: Rfan
 * @Date: 2022-08-03 20:29:15
 * @LastEditTime: 2022-08-04 11:14:02
 */

import { useEffect } from 'react';
import { Button, Form, Modal, Tabs } from 'antd';
import type { ICommonDialog } from '@/interfaces/global';

const { TabPane } = Tabs;
interface IBackupPlanProps extends ICommonDialog {}

function BackupPlanDialog(props: IBackupPlanProps) {
  const { visible, onClose } = props;
  const [form] = Form.useForm();

  useEffect(() => {
    if (visible) {
      //
    }
  }, [visible]);

  /**
   * @description: 关闭弹窗
   */
  const onCancel = () => {
    form.resetFields();
    onClose();
  };

  return (
    <Modal
      title="创建移交申请单"
      visible={visible}
      width={600}
      destroyOnClose
      onCancel={onCancel}
      footer={[
        <Button key="close" onClick={onCancel}>
          取消
        </Button>,
        <Button key="confirm" type="primary">
          确定
        </Button>
      ]}
    >
      <Tabs defaultActiveKey="1" type="card">
        <TabPane tab="备份范围" key="1">
          Content of Tab Pane 1
        </TabPane>
        <TabPane tab="备份方式" key="2">
          Content of Tab Pane 2
        </TabPane>
        <TabPane tab="触发方式" key="3">
          Content of Tab Pane 3
        </TabPane>
      </Tabs>
    </Modal>
  );
}

export default BackupPlanDialog;
